﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StpRecordDetailO_Form.aspx.cs"
    Inherits="RTGS.Web.form.form_StpRecordDetailO_Form" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <link href="<%= ResolveClientUrl("~/css/jquery.validate.error.css") %>" rel="stylesheet"
        type="text/css" />
    <script src="<%= ResolveClientUrl("~/script/helper.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveClientUrl("~/script/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveClientUrl("~/script/jquery.validate.wrapper.js") %>" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function () {


            $("#save").click(function () {


                var typeOutgoing = '<%= Request.Params["typeOutgoing"] %>';

                
                alert(typeOutgoing);

                var handlerUrl = '<%= ResolveClientUrl("~/ajaxhandler/stp_record_detail_o.ashx") %>';

                var trn = encodeURIComponent($('#<%=txtTrn.ClientID %>').val());
                var relatedTrn = encodeURIComponent($('#<%=txtRelatedTrn.ClientID %>').val());
                var debitParticipantsClient = encodeURIComponent($('#<%=txtDebitParticipantsClient.ClientID %>').val());
                var accountDebitParticipantsClient = encodeURIComponent($('#<%=txtAccountDebitParticipantsClient.ClientID %>').val());
                var creditParticipantsClient = encodeURIComponent($('#<%=txtCreditParticipantsClient.ClientID %>').val());
                var accountParticipantsClient = encodeURIComponent($('#<%=txtAccountParticipantsClient.ClientID %>').val());

                var debitParticipant = encodeURIComponent($('#<%=txtDebitParticipant.ClientID %>').val());
                var accountDebitParticipant = encodeURIComponent($('#<%=txtAccountDebitParticipant.ClientID %>').val());
                var creditParticipant = encodeURIComponent($('#<%=txtCreditParticipant.ClientID %>').val());
                var accountCreditParticipant = encodeURIComponent($('#<%=txtAccountCreditParticipant.ClientID %>').val());
                var amount = encodeURIComponent($('#<%=txtAmount.ClientID %>').val());
                var currency = encodeURIComponent($('#<%=txtCurrency.ClientID %>').val());

                var bussinesDay = encodeURIComponent($('#<%=txtBussinesDay.ClientID %>').val());
                var remitanceInformation = encodeURIComponent($('#<%=txtRemitanceInformation.ClientID %>').val());
                var detailOfCharges = encodeURIComponent($('#<%=txtDetailOfCharges.ClientID %>').val());
                var transactionSubTypeCode = encodeURIComponent($('#<%=txtTransactionSubTypeCode.ClientID %>').val());
                var sender = encodeURIComponent($('#<%=txtSender.ClientID %>').val());
                var priority = encodeURIComponent($('#<%=txtPriority.ClientID %>').val());


                var id = $('#<%= hfID.ClientID %>').val();

                var param = '&trn=' + trn
                             + '&relatedTrn=' + relatedTrn
                             + '&debitParticipantsClient=' + debitParticipantsClient
                             + '&accountDebitParticipantsClient=' + accountDebitParticipantsClient
                             + '&creditParticipantsClient=' + creditParticipantsClient
                             + '&accountParticipantsClient=' + accountParticipantsClient
                             + '&debitParticipant=' + debitParticipant
                             + '&accountDebitParticipant=' + accountDebitParticipant
                             + '&creditParticipant=' + creditParticipant
                             + '&accountCreditParticipant=' + accountCreditParticipant
                             + '&amount=' + amount
                             + '&currency=' + currency
                             + '&bussinesDay=' + bussinesDay
                             + '&remitanceInformation=' + remitanceInformation
                             + '&detailOfCharges=' + detailOfCharges
                             + '&transactionSubTypeCode=' + transactionSubTypeCode
                             + '&sender=' + sender
                             + '&priority=' + priority
                               ;

                if (id == 0)
                    CallAjax(handlerUrl, "?method=insert&typeOutgoing=" + typeOutgoing + param);
                else
                    CallAjax(handlerUrl, "?method=update&typeOutgoing=" + typeOutgoing + param + "&id=" + id);

                parent.$('#dialog').dialog("close");

                setTimeout("parent.$('#table').trigger('reloadGrid');", 3000);


                return false;
            });


        });
    
    </script>
  </head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="pnlGroupBox" runat="server" GroupingText="TRN">
            <table border="0" cellpadding="5" cellspacing="0">
                <tr>
                    <td>
                        TRN
                    </td>
                    <td style="padding-left: 120px">
                        <asp:TextBox ID="txtTrn" runat="server" Width="250px"></asp:TextBox>
                    </td>
                    <td style="padding-left: 40px">
                        Related TRN
                    </td>
                    <td style="padding-left: 20px">
                        <asp:TextBox ID="txtRelatedTrn" runat="server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <table border="0">
            <tr>
                <td>
                    <asp:Panel ID="Panel1" runat="server" GroupingText="Debit Participant's Client">
                        <table border="0">
                            <tr>
                                <td>
                                    Debit Participant's Client
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDebitParticipantsClient" runat="server" TextMode="MultiLine"
                                        Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Account of Debit Participant's Client
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAccountDebitParticipantsClient" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td>
                    <asp:Panel ID="Panel2" runat="server" GroupingText="Credit Participant's Client">
                        <table border="0">
                            <tr>
                                <td>
                                    Credit Participant's Client
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCreditParticipantsClient" runat="server" TextMode="MultiLine"
                                        Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Account of Debit Participant's Client
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAccountParticipantsClient" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="Panel3" runat="server" GroupingText="Debit Participant">
                        <table border="0">
                            <tr>
                                <td>
                                    Debit Participant
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDebitParticipant" runat="server" Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Account
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAccountDebitParticipant" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td>
                    <asp:Panel ID="Panel4" runat="server" GroupingText="Credit Participant">
                        <table border="0">
                            <tr>
                                <td>
                                    Credit Participant
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCreditParticipant" runat="server" Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Account
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAccountCreditParticipant" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="Panel5" runat="server" GroupingText="Amount">
                        <table border="0">
                            <tr>
                                <td>
                                    Amount
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAmount" runat="server" Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Currency
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCurrency" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Bussines Day
                                </td>
                                <td>
                                    <asp:TextBox ID="txtBussinesDay" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td>
                    <asp:Panel ID="Panel6" runat="server" GroupingText="Details">
                        <table border="0">
                            <tr>
                                <td>
                                    Remitance Information
                                </td>
                                <td>
                                    <asp:TextBox ID="txtRemitanceInformation" TextMode="MultiLine" runat="server" Width="300px"
                                        Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Details Of Charges
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDetailOfCharges" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Transaction's Sub Type Code
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTransactionSubTypeCode" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Sender To Receiver Information
                                </td>
                                <td>
                                    <asp:TextBox ID="txtSender" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="Panel7" runat="server" GroupingText="Priority">
                        <table border="0">
                            <tr>
                                <td>
                                    Priority
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPriority" runat="server" Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td>
                    <asp:Panel ID="Panel8" runat="server" GroupingText="Draft Details">
                        <table border="0">
                            <tr>
                                <td>
                                    Document Step
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDocumentStep" runat="server" Width="300px" Rows="1"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Comment Charges
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCommentCharges" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <td>
                        <div style="text-align: right; padding-top: 10px;">
                           <a href="#" id="save" class="dialog_link ui-state-default ui-corner-all" alt="Save"
                                onclick="parent.$('#dialog').dialog('Save');"><span class="ui-icon ui-icon-close">
                                </span>Save</a>&nbsp;<a href="#" id="close" class="dialog_link ui-state-default ui-corner-all" alt="Close"
                                onclick="parent.$('#dialog').dialog('close');"><span class="ui-icon ui-icon-close">
                                </span>Close</a>
                        </div>
                    </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:HiddenField ID="hfID" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
